/**
 * Created by wangwei on 16/11/12.
 * 报表基类
 * @returns {*|{}}
 * @constructor
 */
function PieReport(dataSource) {
    //生成报表积累
    var base = BaseReport();

    //扩展
    var self = base.extend({
        getChartOptions: function() {
            var ds = this.getDataSource();
            var chartOptions = {
                lang: {
                    downloadJPEG:"下载JPEG图片",
                    downloadPDF:"下载PDF文件",
                    downloadPNG:"下载PNG图片",
                    downloadSVG:"下载SVG图片",
                    printChart:"打印图表"
                },
                credits:{
                    enabled:false
                },
                chart: {
                    plotBackgroundColor: null,
                    plotBorderWidth: null,
                    plotShadow: false,
                    type: 'pie'
                },
                title: {
                    text: ds.chart.title
                },
                subtitle: {
                    text: ds.chart.subTitle
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,
                        cursor: 'pointer',
                        dataLabels: {
                            enabled: true,
                            format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                            style: {
                                color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                            },
                            connectorColor: 'silver'
                        }
                    }
                },
                series: []
            };

            return chartOptions;
        }
    });
    return self;
}